package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.common.service.BaseService;
import com.gdqy.FCS.dao.DictionaryDao;
import com.gdqy.FCS.entity.Dictionary;


@Service
@Transactional
public class DictionaryService extends BaseService{
	
	
	@Autowired
	private DictionaryDao dictionaryDao;

	/**
	 * 
	 *作者：张伟键
	 *方法描述：通过Type_code查询字典
	 * @param type_code
	 * @return
	 */
	public List<Dictionary> selectByType_code(String type_code){
		return dictionaryDao.selectByType_code(type_code);
	}
	
	/**
	 * 
	 *作者：张伟键
	 *方法描述：通过value查询字典
	 * @param value
	 * @return
	 */
	public Dictionary selectByValue(String value){
		return dictionaryDao.selectByValue(value);
	}
	/**
	 * 
	 *作者：张伟键
	 *方法描述：通过Type_code和code俩个字段去查询字典
	 * @param dictionary
	 * @return
	 */
	public Dictionary selectByType_codeAndCode(Dictionary dictionary){
		return dictionaryDao.selectByType_codeAndCode(dictionary);
	}
	/**
	 * 
	 *作者：张伟键
	 *方法描述：通过字典类型中的name查询字典
	 * @param name
	 * @return
	 */
	public List<Dictionary> selectByDicTypeName(String name){
		return dictionaryDao.selectByDicTypeName(name);
	}
	/**
	 * 
	 *作者：张伟键
	 *方法描述：通过字典表中的code查询字典
	 * @param code
	 * @return
	 */
	public Dictionary selectByCode(String code){
		return dictionaryDao.selectByCode(code);
	}
	
	public List<Dictionary> selectAll(){
		return dictionaryDao.selectAll();
	}
	
	public int insert(Dictionary dictionary) {
		return dictionaryDao.insert(dictionary);
	}
}
